package org.stimuliband.microphone;

/**
 *
 * @author
 */
public class SinusOscilator {

    final double hz;
    final double volume;
    int rate = 8000;
    double from = Math.PI;

    public SinusOscilator(double hz, double volume) {
        this.hz = hz;
        this.volume = volume;
    }

    double next(int x) {
        return Math.sin(from + (2 * Math.PI * hz / rate) * x) * volume;
    }
}
